using System.Reflection;
using Microsoft.EntityFrameworkCore;
using TodoList.Data;
using TodoList.MinimalApi.Extensions;
using TodoList.Shared;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddEndpoints(Assembly.GetExecutingAssembly());
builder.Services.AddDbContext<ApplicationDbContext>(options =>
	options.UseInMemoryDatabase("TodoList"));
var app = builder.Build();
app.MakeSureDbCreated();
app.UseSwaggerWithUi();
app.MapEndpoints();
app.Run();
